<?php
class MessageEvent extends Event
{
	const MESSAGE = "<MessageEvent>: Message";
	
	public $from;
	public $command;
	public $to;
	public $params;
	
	function __construct($aType, $aData = null, $aFrom = null, $aCommand = null, $aTo = null, $aParams = null)
	{
		$this->type = $aType;
		$this->data = $aData;
		$this->from = $aFrom;
		$this->command = $aCommand;
		$this->to = $aTo;
		$this->params = ($aParams == null || !is_array($aParams)) ? array() : $aParams;
	}
	
	function toString()
	{
		return "[from='" . $this->from . "', to='" . $this->to . "' , command='" . $this->command . "', params='" . implode(',', $this->params) . "']";
	}
}
?>